using System.Collections.Generic;

namespace CodeGears.WorkItemTracking.ChartingDashboard.Domain
{
    public class QueryResult : List<Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem>
    {
        public List<Field> GetFieldDefinitions()
        {
            var fields = new List<Field>();

            if (Count == 0) return fields;

            foreach (Microsoft.TeamFoundation.WorkItemTracking.Client.Field field in this[0].Fields)
            {
                fields.Add(new Field(field));
            }

            fields.Sort((f1, f2) => f1.TfsField.Name.CompareTo(f2.TfsField.Name));
            return fields;
        }
    }
}